package com.sylli.oeuf.server.object.transferable;

import java.util.List;

import com.sylli.oeuf.server.game.logic.Plan;
import com.sylli.oeuf.server.game.logic.invocation.LogicObjectFactory;

public class StrategyTO extends BasedTO {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2352892444013550162L;
	
	private int strategyId;
	
	private String defaultSkillName;
	
	private int defaultSkillRank;
	
	private List<StrategyEntryTO> entries;

	public String getDefaultSkillName() {
		return defaultSkillName;
	}

	public void setDefaultSkillName(String defaultSkillName) {
		this.defaultSkillName = defaultSkillName;
	}

	public List<StrategyEntryTO> getEntries() {
		return entries;
	}

	public void setEntries(List<StrategyEntryTO> entries) {
		this.entries = entries;
	}

	public int getDefaultSkillRank() {
		return defaultSkillRank;
	}

	public void setDefaultSkillRank(int defaultSkillRank) {
		this.defaultSkillRank = defaultSkillRank;
	}
	
	public Plan toGameLogicObject() {
		Plan plan = new Plan();
		plan.setPlanId(strategyId);
		plan.setDefaultSkill(LogicObjectFactory.createSkillByName(defaultSkillName));
		plan.setDefaultSkillRank(defaultSkillRank);
		for (StrategyEntryTO _entry : entries) {
			plan.addDispatcherEntry(_entry.toGameLogicObject());
		}
		return plan;
	}

	public int getStrategyId() {
		return strategyId;
	}

	public void setStrategyId(int strategyId) {
		this.strategyId = strategyId;
	}
	
}
